import request from '@/utils/request'
// 请求企业部门列表
export function getDepartments() {
    return request({
      url: '/api/company/department',
      method: 'get',
    })
  }

//   获取员工简单列表
  export function getEmployeeSimple() {
    return request({
      url: '/api/sys/user/simple',
      method: 'get',
    })
  }

  //   新增部门接口
  export function addDepartments(data) {
    return request({
      url: '/api/company/department',
      method: 'post',
      data
    })
  }

    //   删除部门接口
    export function delDepartments(id) {
      return request({
        url: '/api/company/department/'+id,
        method: 'delete',
      })
    }

    // 编辑部门接口
    export function getDepartmentsId(id) {
      return request({
        url: '/api/company/department/'+id,
        method: 'get',
      })
    }

    // 更新编辑部门数据
    export function updateDepartments(data) {
      return request({
        url: '/api/company/department/'+ data.id,
        method: 'put',
        data
      })
    }